package com.aco.party.web.validator.system;

import com.aco.party.web.command.system.Edit${poNameC}Command;
import org.springframework.validation.Errors;
import org.springframework.validation.ValidationUtils;
import org.springframework.validation.Validator;

/**
* Created by flying on 3/10/2016 0010.
*/
public class Edit${poNameC}Validator implements Validator {
@Override
public boolean supports(Class<?> aClass) {
return Edit${poNameC}Command.class.isAssignableFrom(aClass);
}

@Override
public void validate(Object o, Errors errors) {
ValidationUtils.rejectIfEmptyOrWhitespace(errors, "name", "error.name.empty", "名字不能为空");
ValidationUtils.rejectIfEmptyOrWhitespace(errors, "eName", "error.eName.empty", "英文名不能为空");
ValidationUtils.rejectIfEmptyOrWhitespace(errors, "company", "error.company.empty", "开始日期不能为空");
ValidationUtils.rejectIfEmptyOrWhitespace(errors, "position", "error.position.empty", "结束日期不能为空");
ValidationUtils.rejectIfEmptyOrWhitespace(errors, "platform", "error.platform.empty", "活动名称不能为空");
ValidationUtils.rejectIfEmptyOrWhitespace(errors, "type", "error.type.empty", "前言不能为空");
ValidationUtils.rejectIfEmptyOrWhitespace(errors, "area", "error.area.empty", "描述不能为空");
}
}
